#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int ans = 0;
    for(int l = 0, r = 1; r < n; ) {
        if(a[r] * 2 > a[r - 1]) {
            r++;
        }else{
            int t = r;
            l = r, r = t + 1;
        }
        if(r - l == k + 1) {
            ans++;
            l++;
        }
    }
    cout << ans << endl;
}

signed main() {
    int t = 1;
    cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}